package org.zoomdev.zoom.dao.executor;

import org.zoomdev.zoom.dao.SqlConfig;

import java.util.List;

public interface SqlExecutor {

    default <T> int[] executeList(SqlConfig cfg, List<T> data) {
        int[] ret = new int[data.size()];
        for (int i = 0, c = data.size(); i < c; ++i) {
            ret[i] = execute(cfg, data.get(i));
        }
        return ret;
    }

    int execute(SqlConfig cfg, Object data);
}
